public class Knight implements Piece {

    private Color color;
    private int moveCount;

    public Knight( Color color ) {
	this.color = color;
	moveCount = 0;
    }

    public boolean legalMove( int x1, int y1, int x2, int y2 ) {
	if( (x1 == x2) || (y1 == y2) ) {
	    return false;
	}
	int deltaX = Math.abs(x1-x2);
	int deltaY = Math.abs(y1-y2);
	int maxMovement = Math.max(deltaX,deltaY);
	int minMovement = Math.min(deltaX,deltaY);
	if( (maxMovement == 2) && (minMovement == 1) ) {
	    return true;
	}
	return false;
    }

    public Color color() {
	return color;
    }

    public String name() {
	return "Knight";
    }

    public void movesPlusOne() {
	moveCount += 1;
    }
    
    public int moveCount() {
	return moveCount;
    }


}
